package com.ubigroup.server.jena;

import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.tdb.TDBFactory;
import com.hp.hpl.jena.util.FileManager;
import com.ubigroup.server.util.Constants;

public class Jena {
	// Direct way: Make a TDB-backed Jena model in the named directory.
	// convert .owl to .rdf
	Dataset dataset = TDBFactory.createDataset(Constants.DIRETORIO_TDB + Constants.TDB);
	Model model = dataset.getNamedModel(Constants.RDF_PERFIL.)
	//getDefaultModel();
	
	// some definitions
	static String personURI    = "http://somewhere/JohnSmith";
	static String fullName     = "John Smith";

	// create an empty Model

	// create the resource
	Resource johnSmith = model.createResource(personURI);
	
	// add the property
	// johnSmith.addProperty(VCARD.FN, fullName);
	
	// SPARQL : Query, QueroExecution
	
	// fechar model e dataset com .close apos uso
	
	public void login() {
		FileManager.get().readModel(model, Constants.DIRETORIO_RDF + Constants.RDF_PERFIL);
	}

}
